package leecode

func makeSmallestPalindrome(s string) string {
	arr := []byte(s)
	for left, right := 0, len(s)-1; left < right; left, right = left+1, right-1 {
		if arr[left] == arr[right] {
			continue
		}
		if arr[left] < arr[right] {
			arr[right] = arr[left]
		} else {
			arr[left] = arr[right]
		}
	}
	return string(arr)
}
